import http from 'http'
import https from 'https'

let axiosConfig = {
  timeout: 30000,
  crossDomain: true,
  // the data format of the response: json / blob /document /arraybuffer / text / stream
  responseType: 'json',
  // be use for node.js
  httpAgent: new http.Agent({keepAlive: true}),
  httpsAgent: new https.Agent({keepAlive: true})
}

export let axiosConfigUnLogged = {...axiosConfig}

export let uploadConfig = {
  timeout: 120000,
  crossDomain: true,
  responseType: 'json',
  headers: {'Content-Type': 'multipart/form-data'},
  httpAgent: new http.Agent({keepAlive: true}),
  httpsAgent: new https.Agent({keepAlive: true})
}

export default axiosConfig
